From: Weijie Gao Date: Sat, 14 Jun 2025 15:01:55 +0000 (+0800) Subject: fix generating syscall-names.h for loongarch64 X-Git-Url: http://git.openwrt.org/%22http:/oss.oetiker.ch/rrdtool//%22/%22http:/oss.oetiker.ch/rrdtool/%22?a=commitdiff_plain;h=cde025d5baf32e62b485ef9f8ba1e835ba8ece0e;p=project%2Fprocd.git fix generating syscall-names.h for loongarch64 The from musl loongarch64 arch contains some indirect syscall definitions: #define __NR3264_fcntl 25 #define __NR_fcntl __NR3264_fcntl This will result in incorrect contents generated by make_syscall_h_sh: [__NR3264_fcntl] = "fcntl", To fix this issue, all macros staring with __NR3264_ should be also copied to the generated syscall-names.h Signed-off-by: Weijie Gao --- diff --git a/make_syscall_h.sh b/make_syscall_h.sh index 17e3bc4..6e2161c 100755 --- a/make_syscall_h.sh +++ b/make_syscall_h.sh @@ -12,6 +12,10 @@ CC=$1 [ -n "$TARGET_CC_NOCACHE" ] && CC=$TARGET_CC_NOCACHE echo "#include " + +# for loongarch __NR3264_* macros +echo "#include " | ${CC} -E -dM - | grep '^#define __NR3264_[a-z0-9_]\+[ \t].*[0-9].*$' + echo "static const char *__syscall_names[] = {" echo "#include " | ${CC} -E -dM - | grep '^#define __NR_[a-z0-9_]\+[ \t].*[0-9].*$' | \ LC_ALL=C sed -r -n -e 's/^\#define[ \t]+__NR_([a-z0-9_]+)[ \t]+([ ()+0-9a-zNR_LSYCABE]+)(.*)/ [\2] = "\1",/p'